﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleSalesTrackingAPIWrapper
{
    public class SaleContact
    {
        // Get list of all SaleContacts belonging to this company
        public static List<SimpleSalesTrackingAPI.SaleContact> GetSaleContactsByOwner(string username, string password)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return new List<SimpleSalesTrackingAPI.SaleContact>(api.GetSaleContactsByOwner(username, password));
        }

        // Get list of all SaleContacts belonging to the currently authenticated user.
        public static List<SimpleSalesTrackingAPI.SaleContact> GetSaleContactsByUser(string username, string password)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return new List<SimpleSalesTrackingAPI.SaleContact>(api.GetSaleContactsByUser(username, password));
        }

        // Get a single SaleContact, by SaleContactId
        public static SimpleSalesTrackingAPI.SaleContact GetSaleContactById(string username, string password, int saleContactId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.GetSaleContactById(username, password, saleContactId);
        }

        // Insert a new SaleContact
        public static int InsertSaleContact(string username, string password, SimpleSalesTrackingAPI.SaleContact saleContact)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.InsertSaleContact(username, password, saleContact);
        }

        // Insert a new SaleContact
        public static int InsertSaleContact(string username, string password, int saleId, int contactId, string note, bool isSalesLead, bool isSalesSupport, bool isCustomer, bool isVendor)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.InsertSaleContact2(username, password, saleId, contactId, note, isSalesLead, isSalesSupport, isCustomer, isVendor);
        }

        // Update an existing SaleContact
        public static int UpdateSaleContact(string username, string password, SimpleSalesTrackingAPI.SaleContact saleContact)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.UpdateSaleContact(username, password, saleContact);
        }

        // Update an existing SaleContact
        public static int UpdateSaleContact(string username, string password, int saleContactId, int saleId, int contactId, string note, bool isSalesLead, bool isSalesSupport, bool isCustomer, bool isVendor)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.UpdateSaleContact2(username, password, saleContactId, saleId, contactId, note, isSalesLead, isSalesSupport, isCustomer, isVendor);
        }

        // Delete an existing SaleContact
        public static int DeleteSaleContact(string username, string password, SimpleSalesTrackingAPI.SaleContact saleContact)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.DeleteSaleContact(username, password, saleContact);
        }

        // Delete an existing SaleContact
        public static int DeleteSaleContact(string username, string password, int saleContactId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.DeleteSaleContact2(username, password, saleContactId);
        }
    }
}
